
<head>
  <title>Minimal PWA</title>
  <meta name="viewport" content="width=device-width, user-scalable=no" />
  <link rel="manifest" href="manifest.json" />
  <link rel="stylesheet" type="text/css" href="main.css">
  <link rel="icon" href="/e.png" type="image/png" />
</head>

<body>
  <div class="revision">Revision 8</div>
  <img src="pwa-fonts.png">
  <div class="main-text">
    Minimal PWA, open Console for more!
  </div>
  <div class="network-message">
    Network:
    <span id="network-status" class="">Good</span>
  </div>
  <script type="text/javascript">
    if (navigator.serviceWorker != null) {
      navigator.serviceWorker.register('sw.js')
      .then(function(registration) {
        console.log('Registered events at scope: ', registration.scope);
      });
    }

    fetch('./data.json')

    var statusEl = document.querySelector('#network-status')
    if (!navigator.onLine) {
      statusEl.classList = ['is-offline']
      statusEl.innerText = 'Offline'
    }
  </script>
</body>
